"use strict";
cc._RF.push(module, '83269+6NMZBUorSh42OI4RO', 'AlertMsg');
// Script/AlertMsg.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {
    Text: {
      "default": null,
      type: cc.Label
    },
    //peopleRun:{ default: null, type: cc.Animation },
    showTimes: 1,
    //隐藏时间
    jumpHeight: 100,
    //跳跃高度
    _isShow: false
  },
  // LIFE-CYCLE CALLBACKS:
  setLabelString: function setLabelString(str) {
    var label = this.node.getChildByName("label").getComponent(cc.Label);
    label.string = str;
    label.horizontalAlign = cc.Label.HorizontalAlign.CENTER;

    label._forceUpdateRenderData(true); // 这里调用一次手动渲染

  },
  // LIFE-CYCLE CALLBACKS:
  onLoad: function onLoad() {
    //	cc.log("showTips.onLoad")
    window.showtips = this; // 初始化计时器

    this.timer = 0;
    this.node.active = true;
    this.node.getChildByName("closeBtn").on('touchend', function (event) {
      this.finish();
    }, this); //      this.node.getChildByName("startBtn").on('touchend',function(event){
    //          console.log("点击到开始");
    // //this.peopleRun.play();
    //      },this);
    //this.node.getChildByName("btnconfir").on('click',function(event){
    //console.log("点击到按钮");
    //},this);
  },
  setJumpAction: function setJumpAction() {
    this.timer = 0; // 跳跃

    var jumpDown = cc.moveBy(this.showTimes, cc.v2(0, this.jumpHeight)).easing(cc.easeCubicActionIn());
    var callback = cc.callFunc(this.finish, this);
    return cc.repeat(cc.sequence(jumpDown, callback), 1);
  },
  finish: function finish() {
    isShow = 0;
    this._isShow = false;

    if (this.node) {
      this.node.active = this._isShow;
    }

    this.node.stopAllActions();
    this.node.destroy();
  },
  start: function start() {} // update (dt) {},

});

cc._RF.pop();